#ifndef __PITERATOR_H__
#define __PITERATOR_H__

#include "Predicate.h"
#include <vector>

//Depth-first iterator
class PIterator
{
public:
	PIterator( Predicate * p );
	~PIterator();

	void operator++()
	{
		curr_idx ++;
	}
	Predicate* value();
	Predicate* operator*()
	{
		return value();
	};
	bool end();
	void reset();

private:
	Predicate* root_p;
	unsigned int curr_idx;
	std::vector<Predicate*>		m_predicate_vec;
	
	void AddChild( Predicate* p );
};

#endif //__PITERATOR_H__